import React,{ useState} from 'react';
import "./list.less"
import { Checkbox, Space } from 'antd-mobile'

function ListItem ({ item, history,submitBtn }) {

    const [Value,setValue] = useState();
    const changeRadio = (v,item)=>{
        item.checkRadio = v
        setValue(v)
    }

    const selectList = ()=>{
        // item.checkRadio = true
        submitBtn(item)
        // setValue(item)
    }

    return (
        <>
            <div className="box"  onClick={ selectList}>
                <div className="boxTit">
                    <span className="boxTitSize">设备编号:{item.no}</span>
                    {/* <Checkbox
                        value={Value}
                        onChange={v => {
                            changeRadio(v,item)
                        }}
                    > </Checkbox> */}
                    <span style={{color:"#fff",fontSize: 14}} onClick={ selectList}>选择</span>
                </div>
                <div className="boxContent">
                    <div className="bcLine borderB">
                        <span className="bcLineSize">设备名称:</span>
                        <span className="bcLineSize">{item.fixedAssetsName}</span>
                    </div>
                    <div className="bcLine borderB">
                        <span className="bcLineSize">设备类型:</span>
                        <span className="bcLineSize">{item.deviceType}</span>
                    </div>
                </div>
            </div>
        </>
    );
}

export default ListItem;
